package com.flong.desgin.patterns.singleresponsibility;

/**
 * 单一原则
 */
public class SingleResponsibility1 {
    public static void main(String[] args) {
        Vehicle vehicle = new Vehicle();
        vehicle.run("飞机");
        vehicle.run("摩托车");
        vehicle.run("汽车");
    }
}

/**
 * 方法一、
 * 1、在run方法忠
 */
class Vehicle {

    public void run(String vehicle) {
        System.out.println(vehicle + "在公里上跑");
    }
}